gusucode.com > 现代通信系统——使用MATLAB(+全部程序) > 现代通信系统——使用MATLAB(+全部程序)/现代通信系统——使用MATLAB(+全部程序)/Matlab 程序/Chapter1/Rect.m

    function y=rect(x)
% y=rect(x), determines the rectangular function

y=((x>-0.5) & (x<0.5))+0.5*(x==-0.5)+0.5*(x==0.5);